﻿using System.Windows;
using SilverNotes.Common;

namespace SilverNotes
{
  /// <summary>
  /// Some controls doesn't treat UIElement as "legal" content. This class wraps any 
  /// IViewDescriptor, so that it doesn't inherit from UIElement.
  /// </summary>
  public class DescriptorWrapper : IViewDescriptor
  {
    private readonly IViewDescriptor _descriptor;

    public DescriptorWrapper(IViewDescriptor descriptor)
    {
      _descriptor = descriptor;
    }

    public string Category
    {
      get { return _descriptor.Category; }
    }

    public string Title
    {
      get { return _descriptor.Title; }
    }

    public string Description
    {
      get { return _descriptor.Description; }
    }

    public UIElement RootVisual
    {
      get { return _descriptor.RootVisual; }
    }
  }
}